package io.dshubs.archives.controller;


import io.dshubs.archives.service.OcrOfBaiduService;
import io.dshubs.commons.log.annotation.LogOperation;
import io.dshubs.commons.tools.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 百度图像识别
 * </p>
 *
 * @author aidi
 * @since 2021-08-16
 */
@RestController
@RequestMapping("/ocrOfBaidu")
@Api(tags="ocrOfBaidu")
public class OcrOfBaiduController {

    @Autowired
    private OcrOfBaiduService ocrOfBaiduService;


    @GetMapping("/path")
    @ApiOperation("百度图像:path")
    @LogOperation("百度图像:path")
    public Result<Map<String, String>> get(String path){
        Map<String, String> map = ocrOfBaiduService.getImageInfoByFile(path);
        Result<Map<String, String>> result = new Result<Map<String, String>>();
        result.setData(map);
        return result;
    }
}
